|
In mathematics, an initial algebra is an initial object in the category of ''F''-algebras for a given endofunctor ''F''. The initiality provides a general framework for induction and recursion. For instance, consider the endofunctor 1+(-) on the category of sets, where 1 is the one-point set, the terminal object in the category. An algebra for this endofunctor is a set ''X'' (called the ''carrier'' of the algebra) together with a point and a function . The set of natural numbers is the carrier of the initial such algebra: the point is zero and the function is the successor map. For a second example, consider the endofunctor 1+N×(-) on the category of sets, where N is the set of natural numbers. An algebra for this endofunctor is a set ''X'' together with a point and a function . The set of finite lists of natural numbers is the initial such algebra. The point is the empty list, and the function is cons, taking a number and a finite list, and returning a new finite list with the number at the head. ==Final coalgebra== Dually, a final coalgebra is a terminal object in the category of ''F''-coalgebras. The finality provides a general framework for coinduction and corecursion. For example, using the same functor 1+(-) as before, a coalgebra is a set together with a truth-valued test function and a partial function whose domain is formed by those for which . The set consisting of the natural numbers extended with a new element is the carrier of the final coalgebra in the category, where is the test for zero: and , and is the predecessor function (the inverse of the successor function) on the positive naturals, but acts like the identity on the new element : , . For a second example, consider the same functor as before. In this case the carrier of the final coalgebra consists of all lists of natural numbers, finite as well as infinite. The operations are a test function testing whether a list is empty, and a deconstruction function defined on nonempty lists returning a pair consisting of the head and the tail of the input list. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Initial algebra」の詳細全文を読む スポンサード リンク
|